﻿var app = new Vue({
    el: '#app',
    data: {
        loading: false,
        cartModel: {
            stockID:0,
            count:0
        }
    },
    mounted() {

    },
    methods: {
        saveCart() {
            this.loading = true;
            console.log(this.cartModel);
            axios.post('/Cart/AddToCart', this.cartModel)
                .then(res => {
                    console.log(res);
                })
                .catch(err => {
                    console.log(err);
                })
                .then(() => {
                    this.loading = false;
                    location.reload();
                })
        }
    }
})